package com.sk.z.khk.mocktest;

import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;
import static org.hamcrest.core.Is.*;
import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.ReturnValues;
import org.mockito.runners.MockitoJUnit44Runner;

@RunWith(MockitoJUnit44Runner.class)
public class testThenReturn {
	@Mock
	Value value;

	ReturnValue rv;

	@Before
	public void before() {
		rv = new ReturnValue(value);
	}

	@Test
	public void returnValue() {
		when(value.get()).thenReturn(new Integer(1), new Integer(2));

		assertThat(rv.lookup(), is(1));
		assertThat(rv.lookup(), is(2));

		verify(value, times(2)).get();
	}
}
